package com.sta.oldman.config;

import com.sta.oldman.interceptor.UserInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: LunBoWang
 * @description: 配置类
 * @date: 2025/7/15 下午4:12
 * @version: 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private UserInterceptor userInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInterceptor)
                .excludePathPatterns("/user/getCode")
                .excludePathPatterns("/exception")
                .excludePathPatterns("/bindingEmail")
                .addPathPatterns("/**");

    }
}
